﻿using System;
using System.Windows;
using System.Windows.Media;

namespace LpbPrj.Client.Controls;

/// <summary>
/// OpenCloseAttach
/// </summary>
public class OpenCloseAttach
{
    /// <summary>
    /// 开按钮图片
    /// </summary>
    public static readonly DependencyProperty OpenImageSourceProperty = DependencyProperty.RegisterAttached(
        "OpenImageSource", typeof(ImageSource), typeof(OpenCloseAttach), new FrameworkPropertyMetadata(default(ImageSource), FrameworkPropertyMetadataOptions.Inherits));
    public static void SetOpenImageSource(DependencyObject element, ImageSource value) => element.SetValue(OpenImageSourceProperty, value);
    public static ImageSource GetOpenImageSource(DependencyObject element) => (ImageSource)element.GetValue(OpenImageSourceProperty);
    /// <summary>
    /// 开按钮边距
    /// </summary>
    public static readonly DependencyProperty OpenMarginProperty = DependencyProperty.RegisterAttached(
        "OpenMargin", typeof(Thickness), typeof(OpenCloseAttach), new FrameworkPropertyMetadata(new Thickness(0, 0, 5, 0), FrameworkPropertyMetadataOptions.Inherits));
    public static void SetOpenMargin(DependencyObject element, Thickness value) => element.SetValue(OpenMarginProperty, value);
    public static Thickness GetOpenMargin(DependencyObject element) => (Thickness)element.GetValue(OpenMarginProperty);

    /// <summary>
    /// 关按钮图片
    /// </summary>
    public static readonly DependencyProperty CloseImageSourceProperty = DependencyProperty.RegisterAttached(
        "CloseImageSource", typeof(ImageSource), typeof(OpenCloseAttach), new FrameworkPropertyMetadata(default(ImageSource), FrameworkPropertyMetadataOptions.Inherits));
    public static void SetCloseImageSource(DependencyObject element, ImageSource value) => element.SetValue(CloseImageSourceProperty, value);
    public static ImageSource GetCloseImageSource(DependencyObject element) => (ImageSource)element.GetValue(CloseImageSourceProperty);
    /// <summary>
    /// 关按钮边距
    /// </summary>
    public static readonly DependencyProperty CloseMarginProperty = DependencyProperty.RegisterAttached(
        "CloseMargin", typeof(Thickness), typeof(OpenCloseAttach), new FrameworkPropertyMetadata(new Thickness(5, 0, 0, 0), FrameworkPropertyMetadataOptions.Inherits));
    public static void SetCloseMargin(DependencyObject element, Thickness value) => element.SetValue(CloseMarginProperty, value);
    public static Thickness GetCloseMargin(DependencyObject element) => (Thickness)element.GetValue(CloseMarginProperty);

}